package main

import (
	"fmt"
)

func main() {
	var (
		a []int
		b = []int{}
		c = []int{1, 2, 3}
		d = c[:2]
		e = c[0:2:cap(c)]
		f = c[:0]
		g = make([]int, 3)
		h = make([]int, 2, 3)
		i = make([]int, 0, 3)
	)
	fmt.Printf("a\t%#v\nb\t%#v\nc\t%#v\nd\t%#v\ne\t%#v\nf\t%#v\ng\t%#v\nh\t%#v\ni\t%#v\n", a, b, c, d, e, f, g, h, i)

	println(cap(h), cap(i))

	a = append(a, 1)
	fmt.Printf("%p\n", a)
	a = append(a, 1, 2, 3)
	fmt.Printf("%p\n", a)
	a = append(a, []int{1, 2, 3}...)
	fmt.Printf("%p\n", a)
	fmt.Printf("%#v\n", a)

	a = append([]int{0}, a...)
	fmt.Printf("%p\n", a)
	a = append([]int{-3, -2, -1}, a...)
	fmt.Printf("%p\n", a)
	fmt.Printf("%#v\n", a)
}
